from likeshop_project.BASE.myBase import Tools


class login_module(Tools):
    path = "api/account/login"

    def login_action(self, account, password, client=4):
        url = self.host_url + self.path
        data = {
            'account': account,
            'password': password,
            'client': client,
        }
        msg = self.session.post(url=url, json=data)
        return msg.json()


    def get_head(self):
        msg = self.login_action(account='17311111111', password='admin123456')
        head = {
            'token': msg['data']['token']
        }
        return head